package lium.lbs.lbsim.activity

import android.os.Bundle
import com.buz.hjcdriver.bean.AboutUsBean
import com.lmlibrary.bean.ResponseBean
import com.lzy.okgo.model.Response
import kotlinx.android.synthetic.main.activity_about_us.*
import lium.lbs.lbsim.R
import lium.lbs.lbsim.utils.APKVersionCodeUtils
import lium.lbs.lbsim.utils.callbck.DialogCallback
import java.util.HashMap

class AboutUsActivity : BaseActivity() {


    override fun getLayoutId(): Int {
        return R.layout.activity_about_us
    }

    override fun initView(savedInstanceState: Bundle?) {
        setTitleWithBack("关于我们")
    }

    override fun getNetWorkData() {
        getDataList()
    }

    fun getDataList() {
        val param = HashMap<String, String>()
        postData(
            "/member/getAboutUs",
            param,
            object : DialogCallback<ResponseBean<AboutUsBean>>(this) {
                override fun onSuccess(response: Response<ResponseBean<AboutUsBean>>) {
                    setDataList(response.body().data.content)
                }
            })
    }

    fun setDataList(contents: String) {
        tv_name.text = "尚聊V" + APKVersionCodeUtils.getVerName(this)
        tv_about_content.text = contents
    }
}
